#ifndef GRAPH_H
#define GRAPH_H

#include "edge.h"
#include "node.h"
#include <cstddef>
#include <map>
#include <string>
#include <vector>

class Graph {
  public:
    int date{0};
    std::string network;
    std::string dynamic;
    std::string enable_ABM;
    std::string output_type;
    std::string info_level_meta;
    std::string info_level_temp;
    std::map<std::string, double> attr;
    std::vector<Node> V;
    std::vector<std::vector<Edge>> E;

    //这里是傻逼的我因为没写文档新加的部分
    double nS{0};
    double nE{0};
    double nI{0};
    double nR{0};
    void count();

    static size_t randomGen(size_t range);
    static bool choice(double p);
    static double random();
    int Degree(const Node &node);

    void initGraph();
    void update();

    void ER();
    void BA();
    void WS();

    /**
     * @brief S以概率alpha变为I
     */
    void SI();
    void modelSI(Node &node);
    /**
     * @brief S以概率alpha变为I，I有概率beta变为R
     */
    void SIR();
    void modelSIR(Node &node);
    /**
     * @brief S以概率alpha变为I，I有概率beta变为S
     */
    void SIS();
    void modelSIS(Node &node);
    /**
     * @brief S以概率alpha变为E，E以概率beta变为I，I以概率gamma变为R
     */
    void SEIR();
    void modelSEIR(Node &node);
};

Graph GraphGenerator(int argc, char **argv);

#endif
